import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { WorkbenchComponent } from './workbench/workbench.component';
import { ChatComponent } from './chat/chat.component';
import { RecordComponent } from './record/record.component';
import { CalendarComponent } from './calendar/calendar.component';
import { ScheduleComponent } from './schedule/schedule.component';
// import { SettingsComponent } from './settings/settings.component';
import { SelectivePreloadingStrategyService } from './selective-preloading-strategy.service';
import { LoginComponent } from './UI/login/login.component';

const routes: Routes = [
  {path: '', redirectTo: '/workbench', pathMatch: 'full' },
  {path: 'workbench', component: WorkbenchComponent},
  {path: 'chat', component: ChatComponent},
  {path: 'record', component: RecordComponent},
  {path: 'calendar', component: CalendarComponent},
  {path: 'schedule', component: ScheduleComponent},
  {path: 'settings',
    loadChildren: './settings/settings.module#SettingsModule',
    data: { preload: true }
  },
  // {path: 'login', component: LoginComponent}
];

@NgModule({
  imports: [RouterModule.forRoot(routes, {
    enableTracing: false, // <-- debugging purposes only
    preloadingStrategy: SelectivePreloadingStrategyService,
  })],
  exports: [RouterModule]
})

export class AppRoutingModule { }
